<?php
// +----------------------------------------------------------------------
// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2019 http://www.thinkcmf.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 老猫 <thinkcmf@126.com>
// +----------------------------------------------------------------------
namespace app\portal\controller;

use cmf\controller\UserBaseController;
use think\facade\Db;

class IndexController extends UserBaseController
{
    public function index()
    {
        $userid = session('user.id');
        $userInfo =  Db::table('dhgx_user')->where('id',$userid)->find();
        if ($userInfo) {
            //没有查到这个用户了
            $this->assign('user', $userInfo);
            return $this->fetch('index');
        }else{
            session(null);
            $this->error('用户无权限访问！','/');
        }
    }
}
